package com.jmb.apiplatform.service;

import com.jmb.apiplatform.exception.ValidException;
import com.jmb.apiplatform.pojo.ApiTestCacheParameter;
import com.jmb.apiplatform.pojo.ApiTestCacheParameterTO;
import com.jmb.apiplatform.pojo.ApiTestCacheParameterVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author jinbo
* @description 针对表【api_test_cache_parameter(此表是参数缓存，请求参数缓存，响应数据缓存)】的数据库操作Service
* @createDate 2025-02-06 15:53:57
*/
public interface ApiTestCacheParameterService  {
    // 查询参数名称
    ApiTestCacheParameterVO findCacheParameterByName(String name);
    // 根据id查询信息
    ApiTestCacheParameterVO findCacheParameterById(Integer processorId);
    // 根据caseId查询参数缓存
    List<Integer> findCacheParameterByCaseId(Integer caseId);
    // 根据参数名称和caseId查询参数缓存
    List<ApiTestCacheParameterVO> checkCacheParameterName(Integer processorId, String name);
    // 查询参数列表
    List<ApiTestCacheParameterVO> findCacheParameterList(ApiTestCacheParameterTO apiTestCacheParameterTO);

    @Transactional(rollbackFor = ValidException.class)
    ApiTestCacheParameter saveApiTestCacheParameter(ApiTestCacheParameter apiTestCacheParameter) throws ValidException;
    @Transactional(rollbackFor = ValidException.class)
    void editApiTestCacheParameter(ApiTestCacheParameter apiTestCacheParameter) throws ValidException;
    @Transactional(rollbackFor = ValidException.class)
    // 根据id删除参数缓存
    void removeCacheParameterById(Integer processorId);
    @Transactional(rollbackFor = ValidException.class)
    // 根据caseId删除参数缓存
    void removeCacheParameterByCaseId(Integer caseId);

}
